package Mapper;

import entity.SysRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface SysRoleMapper {
    @Select("select * from sys_role limit 1")
    SysRole select1();

    @Select("select * from sys_role limit 5")
    List<SysRole> select2();

    @Select("select ROLE_NAME from sys_role where ROLE_ID=1")
    String select3();

    @Select("select count(1) from sys_role")
    Long select4();

    @Insert("INSERT INTO sys_role (ROLE_ID,ROLE_CODE,ROLE_NAME) VALUE (#{roleId},#{roleCode},#{roleName})")
    int insert1(SysRole role);

    @Update("update sys_role set ROLE_CODE=#{roleCode},ROLE_NAME=#{roleName} where ROLE_ID=#{roleId}")
    int update1(SysRole role);

    @Delete("delete from sys_role where ROLE_ID=#{roleId}")
    int delete1(Integer roleId);
}
